package com.aaa.common.util;

/**
 * @ fileName:ResultStatus
 * @ description: 定义统一返回枚举
 * @ author:zhz
 * @ createTime:2023/5/4 9:01
 * @ version:1.0.0
 */
public enum ResultStatus {

    //成功
    SUCCESS(200,"执行成功"),
    //失败
    ERROR(500,"执行失败"),
    //还可以自定义任何统一返回码和提示信息
    //定义参数不能null的枚举
    PARAM_NOT_EMPTY(5001,"参数不能为空!"),
    REMOTE_METHOD_LIMIT(5002,"远程请求资源被限流!"),
    REMOTE_METHOD_ERROR(5003,"远程请求资源出现异常!"),
    ILLEGAL_CHAR_ERROR(5004,"非法参数错误!"),
    ILLEGAL_IP_ERROR(5005,"非法IP错误!"),
    NO_AUTH_ERROR(5006,"未认证异常!"),
    ;

    private  int returnCode;
    private String returnMsg;

    ResultStatus(int returnCode, String returnMsg) {
        this.returnCode = returnCode;
        this.returnMsg = returnMsg;
    }

    public int getReturnCode() {
        return returnCode;
    }

    public void setReturnCode(int returnCode) {
        this.returnCode = returnCode;
    }

    public String getReturnMsg() {
        return returnMsg;
    }

    public void setReturnMsg(String returnMsg) {
        this.returnMsg = returnMsg;
    }
}
